﻿#include "reader.h"
#include "ui_allreader.h"
#include "ui_reader.h"
#include <QTableView>
#include <QHeaderView>
#include <QStandardItemModel>
#include <QSqlTableModel>
#include <QStandardItem>
#include "allreader.h"
#include"all_book.h"
#include"QGraphicsDropShadowEffect"
Reader::Reader(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Reader)
{
    allreader = new Allreader;
    ui->setupUi(this);

}

Reader::~Reader()
{
    delete ui;
}



void Reader::on_btn_reader_info_clicked()
{
    Search *search=new Search;
    search->show();
    return;
}


void Reader::on_Show_All_clicked()
{
  qDebug()<<"on_Show_All_clicked";
  QSqlQuery sql(global::read->m_db);
 sql.exec("SELECT * FROM Reader");
allreader->is_editing=true;
allreader->public_edit_clicked();
allreader->model->submitAll();
 allreader->show();
}


void Reader::on_credit_clicked()
{
    credit *cred=new credit;
    cred->show();
    return;
}


void Reader::on_book_change_clicked()
{
    book_change *bok_change=new book_change;
    bok_change->show();
    return;
}

